package com.example.a44786.myapplication;

import android.annotation.SuppressLint;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;

import static com.example.a44786.myapplication.R.id.button5;
import static com.example.a44786.myapplication.R.id.button6;


public class LoginActivity extends AppCompatActivity implements View.OnClickListener{
    private Button anniu,anniu1;
    private EditText editText;
    @SuppressLint("WrongViewCast")
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_login);
        anniu=(Button)findViewById(button5);
        anniu1=(Button)findViewById(button6);
        editText=(EditText)findViewById(R.id.mima);
        anniu.setOnClickListener(this);
        anniu1.setOnClickListener(this);
    }
    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case button5:
                String context=editText.getText().toString();
if (context.isEmpty()){
    Toast.makeText(this, "内容不能为空", Toast.LENGTH_SHORT).show();
}
else {
                Intent intent = new Intent(LoginActivity.this, kuang2Activity.class);
                startActivity(intent);}break;
            case button6:
                Intent intent = new Intent(LoginActivity.this, zhuceActivity.class);
                startActivity(intent);break;

        }

    }



}
